home *** CD-ROM | disk | FTP | other *** search
- class ObjectList
- {
- var list;
- var pos;
- function ObjectList()
- {
- this.list = new Array();
- this.pos = 0;
- }
- function add(o)
- {
- if(this.indexOf(o) < 0)
- {
- this.list[this.pos] = o;
- this.pos = this.pos + 1;
- }
- }
- function §get§(index)
- {
- return this.list[index];
- }
- function remove(o)
- {
- var _loc2_ = this.indexOf(o);
- if(_loc2_ >= 0)
- {
- this.list[_loc2_] = this.list[--this.pos];
- }
- }
- function getLength()
- {
- return this.pos;
- }
- function size()
- {
- return this.pos;
- }
- function indexOf(o)
- {
- var _loc2_ = 0;
- while(_loc2_ < this.list.length)
- {
- if(o == this.list[_loc2_])
- {
- return _loc2_;
- }
- _loc2_ = _loc2_ + 1;
- }
- return -1;
- }
- function toArray()
- {
- return this.list;
- }
- }
-